param(
    [ValidateSet('up','down','rebuild','logs','ps')]
    [string]$Cmd = 'up'
)

$Root = Split-Path -Parent $MyInvocation.MyCommand.Path
Push-Location $Root

switch ($Cmd) {
    'up' {
        Write-Host "docker compose up -d --build"
        docker compose up -d --build
    }
    'down' {
        Write-Host "docker compose down"
        docker compose down
    }
    'rebuild' {
        Write-Host "docker compose up -d --build --force-recreate"
        docker compose up -d --build --force-recreate
    }
    'logs' {
        Write-Host "docker compose logs -f"
        docker compose logs -f
    }
    'ps' {
        Write-Host "docker compose ps"
        docker compose ps
    }
}

Pop-Location
